package jj.fly.cloud.controller;


import jj.fly.cloud.entity.User;
import jj.fly.cloud.fiegn.UserFiegnClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MovieController {

    @Autowired
    private UserFiegnClient userFiegnClient;


    @GetMapping("/movie/{id}")
    public User findById(@PathVariable("id") Long id){
        return userFiegnClient.findById(id);
    }

    @GetMapping("/testPost")
    public User testPost(User user){
        return userFiegnClient.postUser(user);
    }
}
